import request from '@/utils/request'

const api = {
    getUnid: '/getUnid'
}

const fileApi = {
    getFile: '/attachment/api/download'
}

export function getNewUnid()
{
    return request({
        url: api.getUnid,
        method: 'get'
    })
}

export function getFile(fileName)
{
    return request({
        url: fileApi.getFile + '?fileName=' + fileName,
        method: 'get',
        responseType: 'blob'
    })
}

export function getFlowList(data)
{
    return request({
        url: '/flow/structure/list',
        method: 'get',
        params: data
    })
}

export function getFlowXmlTwo(data)
{
    return request({
        url: '/flow/func/getFlowStrctureXml',
        method: 'get',
        params: data
    })
}

export function getFlowTitle(param)
{
    return request({
        url: '/flow/func/getFlowTitle',
        method: 'get',
        params: param
    })
}

export function delFlow(data)
{
    return request({
        url: '/flow/structure',
        method: 'Delete',
        params: data
    })
}
export function getFlowXml(unid)
{
    return request({
        url: '/flow/structure/info',
        method: 'get',
        params: { 'unid': unid }
    })
}

export function setFlowXml(flowObj)
{
    return request({
        url: '/flow/structure/save',
        method: 'post',
        data: flowObj
    })
}


export function getNewXh()
{
    return request({
        url: '/flow/structure/getNewXh',
        method: 'get'
    })
}

export function commonRequest(url, method, paramter, data)
{
    return request({
        url: url,
        method: method,
        params: paramter,
        data: data
    })
}

export function commonDownFileRequest(url, method, paramter, data)
{
    return request({
        url: url,
        method: method,
        params: paramter,
        data: data,
        responseType: 'blob'
    })
}

// 复制流程
export function copyFlow(data)
{
    return request({
        url: "flow/flowCopy",
        method: "post",
        data
    })
}

// 获取党建请假详情
export function getQjjl(parameter)
{
    return request({
        url: '/cms/getqjjl',
        method: 'get',
        params: parameter
    })
}
// 获取党建共享资料评论列表
export function getCommentList(parameter)
{
    return request({
        url: "/grzl/comment",
        method: 'get',
        params: parameter
    })
}
// 党建共享资料提交评论
export function submitComment(parameter)
{
    return request({
        url: "/grzl/comment",
        method: 'post',
        data: parameter
    })
}
// 删除评论
export function delComment(parameter)
{
    return request({
        url: "/grzl/xx/scgrpl",
        method: 'Delete',
        params: parameter
    })
}
// 党建 根据法院获取支部
export function getZbList(parameter)
{
    return request({
        url: "/dzzgl/dzzpx",
        method: 'get',
        params: parameter
    })
}
// 党建根据支部获取人员
export function getPersonList(parameter)
{
    return request({
        url: '/dzzgl/dypx',
        method: 'get',
        params: parameter
    })
}
// 党建 保存人员排序
export function savePersonRank(parameter)
{
    return request({
        url: '/dzzgl/dydas',
        method: 'post',
        data: parameter
    })
}
// 党建 保存支部排序
export function saveDptRank(parameter)
{
    return request({
        url: '/dzzgl/partys',
        method: 'post',
        data: parameter
    })
}
// 党建 保存法院排序
export function saveFyRank(parameter)
{
    return request({
        url: '/dzzgl/Orgs',
        method: 'post',
        data: parameter
    })
}

// 获取crm各省客户数量
export function getNumberByArea()
{
    return request({
        url: "/crm/pushCustomNumberByArea",
        method: 'post'
    })
}

//获取短信验证码
export function sendCode(params)
{
    return request({
        url: "/sms/sendCode",
        method: 'get',
        params
    })
}

// 科研考核排名获取部门数据
export function getOrgList(params)
{
    return request({
        url: "/kyxmtj/getOrg",
        method: 'get'
    })
}
// 获取科研考核排名数据
export function getYearKycg(params)
{
    return request({
        url: "/kyxmtj/getThisYearKycg",
        method: 'get',
        params
    })
}

// 获取水印配置参数
export function getSyglck()
{
    return request({
        url: '/sygl/syglck',
        method: 'get'
    })
}
// 水印配置保存
export function saveSygl(parameter)
{
    return request({
        url: "/sygl/sygladding",
        method: 'post',
        data: parameter
    })
}

// 获取会议请假人员
export function getVacationPerson(parameter)
{
    return request({
        url: "/hyxx/getVacationPersonByMeetingId",
        method: 'get',
        params: parameter
    })
}

// 获取房屋库位置数据
export function getFwkList()
{
    return request({
        url: "/fwkglxmgl/xmpointfwk",
        method: 'post'
    })
}
// 根据项目id获取楼栋信息
export function getXmInfo(parameter)
{
    return request({
        url: "/fwkglldgl/xmInfo",
        method: 'get',
        params: parameter
    })
}